const commonRoutes = [
  {
    path: "manger", // 员工异动
    component: () => import("@/views/staff/management/index")
  },
  {
    path: "employee", // 花名册
    component: () => import("@/views/staff/management/employee")
  },
  {
    path: "upload", // 批量导入新员工
    component: () => import("@/views/staff/management/upload")
  },
  {
    path: "uploadFile", // 批量导入合同
    component: () => import("@/views/staff/management/uploadFile")
  },
  {
    path: "batchEdit", // 批量修改员工信息
    component: () => import("@/views/staff/management/batchEdit")
  },
  {
    path: "fileform", // 材料附件
    component: () => import("@/views/staff/management/fileform")
  },
  {
    path: "fileformAdditional", // 材料附件
    component: () => import("@/views/staff/management/fileformAdditional")
  },
  {
    path: "detail", // 员工详情
    component: () => import("@/views/staff/management/info/detail")
  },
  {
    path: "addEmpInfo",
    component: () => import("@/views/staff/management/info/addEmpInfo")
  },
  {
    path: "leave",
    component: () => import("@/views/staff/management/info/leave")
  },
  {
    path: "transfer",
    component: () => import("@/views/staff/management/info/transfer")
  },
  {
    path: "edit", // 员工设置
    component: () => import("@/views/staff/edit/index")
  },
  {
    path: "moveTag", // 已调岗记录
    component: () => import("@/views/staff/management/component/MoveList")
  },
  {
    path: "LeaveList", // 离职记录
    component: () => import("@/views/staff/management/component/LeaveList")
  },
  {
    path: "employee/todayAdd", // 今日新增
    name: "staff/employee/todayAdd",
    component: () => import("@/views/staff/management/todayAdd")
  }
];

export const StaffRouter = {
  path: "/staff", // 人事管理
  component: () => import("@/layout"),
  redirect: "manger",
  children: [].concat(commonRoutes, [
    {
      path: "personalInfo/:type", // 个人信息设置
      component: () => import("@/views/staff/edit/field")
    },
    {
      path: "zaizhixinxi/:type", // 在职信息设置
      component: () => import("@/views/staff/edit/field")
    },
    {
      path: "socialSecurity/:type", // 员工社保设置
      component: () => import("@/views/staff/edit/field")
    },
    {
      path: "information/:type", // 材料附件设置
      component: () => import("@/views/staff/edit/field")
    },
    {
      path: "entryTemplateSet/:type",
      meta: {
        title: "入职模板设置"
      },
      component: () => import("@/views/staff/edit/entryTemplateSet4")
    },
    {
      path: "hiredEntryTemplateSet/:type",
      meta: {
        title: "待入职模板设置"
      },
      component: () => import("@/views/staff/edit/entryTemplateSet4")
    },
    {
      path: "edit/newTemplate",
      meta: {
        title: "新建入职模板设置"
      },
      component: () => import("@/views/staff/edit/newTemplate")
    },
    {
      path: "management/import", // 待离职批量导入
      component: () => import("@/views/staff/management/import")
    }
  ])
};

export const StaffCRouter = {
  path: "/staffc",
  component: () => import("@/layout/adminNew"),
  redirect: "manger",
  children: [].concat(commonRoutes, [
    {
      path: "setting3",
      meta: {
        title: "个人信息设置"
      },
      component: () => import("@/views/staff/edit/setting")
    },
    {
      path: "setting2",
      meta: {
        title: "员工社保设置"
      },
      component: () => import("@/views/staff/edit/setting2")
    },
    {
      path: "setting3",
      meta: {
        title: "材料附件设置"
      },
      component: () => import("@/views/staff/edit/setting3")
    }
  ])
};
